/**
 * Created by dbwyxl on 2017/9/19.
 */
module.exports = function($parse){
  return {
    restrict: 'AE',
    replace: true,
    link: function(scope, element, attrs) {
      element.click(function(){
        if(attrs.scrollTop=='fh'){
          element.parent().scrollTop(0)
        }
      })
      element.scroll(function () {
        if(attrs.scrollTop=='scrol'){
          if(element.scrollTop()>0){
            $('#caseSources-nav').addClass('caseSources-nav-shadow')
          }else{
            $('#caseSources-nav').removeClass('caseSources-nav-shadow')
          }
        }
      })



    }
  }

};
